<load target="../../module/tpl/js/multi_order.js" usecdn="true" />
<load target="../../module/tpl/js/module_list.js" usecdn="true" />
<load target="../../module/tpl/js/mid.js" usecdn="true" />
<!--%load_js_plugin("ui.colorpicker")-->
<div class="x_control-group">
	<label class="x_control-label" for="skin">{$lang->skin}</label>
	<div class="x_controls">
		<select name="skin" id="skin">
			<option value="">{$lang->select}</option>
			<option loop="$skin_list => $skin_name, $skin" value="{$skin_name}">{$skin->title}({$skin_name})</option>
		</select>
		<input type="button" class="x_btn" value="{$lang->cmd_select}" />
	</div>
</div>
<div class="x_control-group">
	<label class="x_control-label" for="colorset">{$lang->colorset}</label>
	<div class="x_controls">
		<select name="colorset" id="widget_colorset">
		</select>
	</div>
</div>
<div class="x_control-group">
	<label class="x_control-label" for="widget_cache">{$lang->widget_cache}</label>
	<div class="x_controls">
		<input type="number" name="widget_cache" id="widget_cache" value="0" size="2" /> {$lang->unit_min}
		<p class="x_help-inline">{$lang->about_widget_cache}</p>
	</div>
</div>
{@$suggestion_id = 0}
<block loop="$widget_info->extra_var => $id, $var">
	{@$suggestion_id++}
	<block cond="!$not_first && !$var->group"><section class="extra_vars section"></block>
	<block cond="$group != $var->group">
		<block cond="$not_first"></section></block>
		<section class="extra_vars section">
		<h1>{$var->group}</h1>
		{@$group = $var->group}
	</block>
	{@$not_first = true}
	<div class="x_control-group <!--@if($var->type == 'mid' || $var->type == 'module_srl_list')-->moduleSearch moduleSearch1 modulefinder<!--@end-->">
		<label class="x_control-label" for="{$id}">{$var->name}</label>
		<div class="x_controls">
			<div cond="$var->type == 'text'">
				<input type="text" name="{$id}" />
			</div>
			<input cond="$var->type == 'color'" type="text" name="{$id}" value="" id="{$id}" class="color-indicator" style="width:178px" />
			<div cond="$var->type == 'textarea'">
				<textarea cond="$var->type == 'textarea'" name="{$id}" id="{$id}" rows="8" cols="42"></textarea>
			</div>
			<select cond="$var->type == 'select'" name="{$id}" id="{$id}">
				<option loop="$var->options => $key, $val" value="{$key}">{$val}</option>
			</select>
			<block cond="$var->type == 'select-multi-order'">
				<!--@if($var->init_options && is_array($var->init_options))-->
				{@$inits = array_keys($var->init_options)}
				<input type="hidden" name="{$id}" value="{implode(',', $inits)}" />
				<!--@else-->
				<input type="hidden" name="{$id}" value="" />
				<!--@end-->
				<div style="display:inline-block;padding-top:3px">
					<label>{$lang->display_no}</label>
					<select class="multiorder_show" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px">
						<option loop="$var->options => $key, $val" cond="!$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
					</select>
					<br>
					<button type="button" class="x_btn multiorder_add" style="vertical-align:top">{$lang->cmd_insert}</button>
				</div>
				<div style="display:inline-block;padding-top:3px">
					<label>{$lang->display_yes}</label>
					<select class="multiorder_selected" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px">
						<option loop="$var->options => $key, $val" cond="$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
					</select>
					<br>
					<button type="button" class="x_btn multiorder_up" style="margin:0 -5px 0 0;border-radius:2px 0 0 2px">{$lang->cmd_move_up}</button>
					<button type="button" class="x_btn multiorder_down" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_down}</button>
					<button type="button" class="x_btn multiorder_del" style="border-radius:0 2px 2px 0">{$lang->cmd_delete}</button>
				</div>
				<script>
					xe.registerApp(new xe.MultiOrderManager('{$id}'));
				</script>
			</block>
			<block cond="$var->type == 'mid_list'">
				<fieldset loop="$mid_list => $module_category_srl, $modules">
					<block cond="count($mid_list) > 1">
						<legend cond="$modules->title">{$modules->title}</legend>
						<legend cond="!$modules->title">{$lang->none_category}</legend>
					</block>
					<div loop="$modules->list => $key, $val">
						<label class="x_inline"><input type="checkbox" value="{$key}" name="{$id}" /> {$key} ({$val->browser_title})</label>
					</div>
				</fieldset>
			</block>
			<block cond="$var->type == 'member_group'">
				<block loop="$group_list => $key, $val">
					<label class="x_inline"><input type="checkbox" value="{$key}" name="{$id}" id="chk_member_gruop_{$id}_{$key}" /> {$val->title}</label>
				</block>
			</block>
			<block cond="$var->type == 'module_srl_list'">
				<input type="hidden" name="{$id}" value="" />
				<select class="modulelist_selected" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px"></select>
				<p class="x_help-inline">{$var->description}</p>
				<br>
				<a href="#" id="__module_srl_list_{$id}" class="x_btn moduleTrigger" data-multiple="true" style="margin:0 -5px 0 0;border-radius:2px 0 0 2px">{$lang->cmd_add}</a>
				<button type="button" class="x_btn modulelist_up" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_up}</button>
				<button type="button" class="x_btn modulelist_down" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_down}</button>
				<button type="button" class="x_btn modulelist_del" style="border-radius:0 2px 2px 0">{$lang->cmd_delete}</button>
				<script>
					xe.registerApp(new xe.ModuleListManager('{$id}'));
				</script>
			</block>
			<block cond="$var->type == 'mid'">
				<input type="hidden" name="{$id}" value="" />
				<input type="text" readonly="readonly" />
				<a href="#" class="x_btn moduleTrigger">{$lang->cmd_select}</a>
				<button type="button" class="x_btn delete">{$lang->cmd_delete}</button>
				<script>
					xe.registerApp(new xe.MidManager('{$id}'));
				</script>
			</block>
			<block cond="$var->type == 'filebox'">
				{@$use_filebox = true}
				<input type="hidden" name="{$id}" />
				<a class="x_btn modalAnchor filebox" href="#modalFilebox">{$lang->cmd_select}</a>
			</block>
			<select cond="$var->type == 'menu'" name="{$id}">
				<option value="">-</option>
				<option loop="$menu_list => $key, $val" value="{$val->menu_srl}">{$val->title}</option>
			</select>
			<p cond="$var->description">{$var->description}</p>
		</div>
	</div>
</block>
</section>
<script>
	xe.current_lang = "{$lang_type}";
</script>
